using System;
using System.Collections.Generic;
using System.Linq;
using Hematology.Data.Interface;

namespace Hematology.Data
{
	public partial class Region : IComparable<Region>, IGeoItem
	{
		public static List<Region> GetAllRegions(int countryId, bool? isOnlyVisible)
		{
			List<Region> regionList = Search(null, countryId, null, isOnlyVisible);
			regionList.Sort();
			return regionList;
		}

		public int CompareTo(Region other)
		{
			return Name.CompareTo(other.Name);
		}

		public static Region SearchByName(string name)
		{
			return Search(null, null, name, null).FirstOrDefault();
		}
	}
}